<template>
  <div>
    <!-- 轮播图 -->
    <!-- <mt-swipe :auto="4000">
      <mt-swipe-item v-for=" item in lunboList" :key="item.id">
        <img :src="item.img" alt />
      </mt-swipe-item>
    </mt-swipe> -->
    <!-- 父组件向子组件传递了一个 lunbotulist[] -->
    <swiper :lunbotuList="lunbotulist" :isfull="true"></swiper>

    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
        <router-link to="/home/goodslist">
          <img src="../../images/menu1.png" alt="">
          <div class="mui-media-body">天猫</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
        <router-link to="/home/newslist">
          <img src="../../images/menu2.png" alt="">
          <div class="mui-media-body">新闻资讯</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
        <router-link to="/home/photolist">
          <img src="../../images/menu3.png" alt="">
          <div class="mui-media-body">图片分享</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
        <a href="#">
          <img src="../../images/menu4.png" alt="">
          <div class="mui-media-body">外卖</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
        <a href="#">
          <img src="../../images/menu5.png" alt="">
          <div class="mui-media-body">天猫超市</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
        <a href="#">
          <img src="../../images/menu6.png" alt="">
          <div class="mui-media-body">充值中心</div>
        </a>
      </li>
    </ul>
  </div>
</template>
<script>
import { Toast } from "mint-ui";
//导入swiper组件
import swiper from "../subcomponents/swiper.vue"
export default {
  data() {
    return {
      lunbotulist: []
    };
  },
  created() {
    this.getSwipeData();
  },
  methods: {
    getSwipeData() {
      //获取轮播图数据
      this.$http
        .get("api/getlunbo")
        .then(result => {
          console.log(result.body);
          console.log(result.status);
          console.log(result.body.status);
          if (result.body.status === 0) {
            //返回的结果是成功的
            this.lunbotulist = result.body.message;
            console.log(" >>>>> "+this.lunbotulist);
            // Toast("加载轮播图数据成功");
          } else {
            Toast("加载数据失败");
          }
        });
    }
  },
  components:{ //关联此组件
    swiper
  }
};
</script>

<style lang="scss" scoped>
// .mint-swipe {
//   height: 200px;
//   .mint-swipe-item {
//     &:nth-child(1) {
//       background-color: red;
//     }
//     &:nth-child(2) {
//       background-color: blue;
//     }
//     &:nth-child(3) {
//       background-color: yellow;
//     }
//     img {
//       width: 100%;
//       height: 100%;
//     }
//   }
// }

.mui-grid-view.mui-grid-9{
    background-color: snow;
    border: none;
    img{
        width: 65px;
        height: 50px;
    }
    li{
        border: 0;
    }
}
.mui-grid-view .mui-grid-9{
    background-color: snow;
    border: none;
}

</style>
